home *** CD-ROM | disk | FTP | other *** search
/ CD/PC Actual 76 / DVD Actual 1 Marzo 2003.iso / Trial / TurboCAD 7.1 Pro / Data.Cab / F25225_mImageButton.java < prev    next >
Encoding:
Java Source  |  2000-11-10  |  964 b   |  31 lines

  1. //import ImageButton;
  2. import java.awt.Event;
  3. import symantec.itools.awt.ImageButton;
  4. /*
  5.      mImageButton   RHM@1997 used to override the mouseDown, capturing the right click and 
  6.                     posting it as META (right click) and passing left mouse click on to ImageButton.
  7.                     This is used so that events come seperately from left and right mouse actions.
  8.  */ 
  9. public class mImageButton extends symantec.itools.awt.ImageButton
  10. {
  11.     public mImageButton()
  12.     {   super();
  13.     }
  14.  
  15.     // Override mouse down to post META Key (right mouse) as seperate from left mouse down
  16.     public boolean mouseDown(java.awt.Event e, int x, int y)  
  17.     {
  18.         boolean ret;
  19.         if (e.modifiers != java.awt.Event.META_MASK)
  20.             ret = super.mouseDown(e, x, y);
  21.         else
  22.         {   e.id = Event.ACTION_EVENT;   // change to ACTION event
  23.             ret = postEvent(e);
  24.         }
  25.         return ret;
  26.     }
  27.  
  28.  
  29. }
  30.  
  31.